﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Green.AgileMapper;

namespace Green.AgileMapper.Test
{
    public class StudenDto
    {
        public int ID
        {
            get;
            set;
        }

        public string Name
        { get; set; }

        public Sex Sex
        { get; set; }

        [Mapping("Address.Country")]
        public string Country
        {
            get;
            set;
        }

        [Mapping("Address.Province")]
        public string Province
        { get; set; }

        // [Mapping("Address.Street")]
        [IgnoreMapping]
        public string Street
        { get; set; }

        [ExpressionMapping("domainObj.Address.Country +\" 国籍 \"+domainObj.Address.Province +\" 省 \"")]
        public string Particular
        { get; set; }

        [ObjectMappingAttribute]
        public ContactWayDto ContactWay
        { get; set; }

        [CollectionMapping()]
        public List<string> CourseIds
        { get; set; }

        [CollectionMapping(EqualExpression = "fromObjItem.Key==domainObjItem.Key", IsDeleteNotInFromItem = true)]
        public List<KeyValuePairDto> Propertys
        { get; set; }

        [ExpressionMapping("domainObj.Propertys[0].Key")]
        public string FirstPropertyKey
        {
            get;
            set;
        }
        [ObjectMapping()]
        
        public TestBase Test { get; set; }
    
        [CollectionMapping]
        public List<TestBase> Tests { get; set; }


    }
    public class KeyValuePairDto
    {
        public string Key
        { get; set; }

        public string Value
        { get; set; }
    }

}
